﻿using System;
using Autodesk.Revit.DB;
using YJKRevitKernel.ElementSearchUtility.LinkDocumentSuite;
using YJKPatternSign.StairsRoomSection.DataDefine;
using YJKPatternSign.StairsRoomSection.Kit;

namespace YJKPatternSign.StairsRoomSection.ElementPacket
{
	internal class StairsRunObject : ElementObject
	{
		public StairsRunObject(BaseLinkDocumentResultBean LinkElem, SectionViewData secviewData = null) : base(LinkElem, secviewData)
		{
			this.m_objectType = ObjectType.kStairsRunType;
		}

		public override void GetMaterial()
		{
			string strMaterial = "无";
			Document document = base.SelfElem.UseElement.Document;
			ElementId typeId = base.SelfElem.UseElement.GetTypeId();
			Parameter parameter = document.GetElement(typeId).get_Parameter(BuiltInParameter.STAIRS_RUNTYPE_RUN_MATERIAL);
			document.GetElement(parameter.AsElementId());
			Material material = document.GetElement(parameter.AsElementId()) as Material;
			if (material != null)
			{
				strMaterial = material.Name;
			}
			this.m_strMaterial = strMaterial;
		}
	}
}
